package com.jiutianniao.p2p.acctrans.core.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jiutianniao.p2p.acctrans.core.dal.dao.AccountLogDao;
import com.jiutianniao.p2p.acctrans.core.dal.model.AccountLogDO;
import com.jiutianniao.p2p.acctrans.core.service.AccountLogService;
import com.jiutianniao.p2p.base.web.page.MybatisPageHelper;
import com.jiutianniao.p2p.base.web.page.PageVo;
import com.jiutianniao.p2p.trans.client.model.AccountLogQueryDto;
import com.jiutianniao.p2p.trans.client.model.AccountLogVO;

@Service("accountLogService")
public class AccountLogServiceImpl implements AccountLogService {

	@Resource
	private AccountLogDao accountLogDao;

	@Override
	public void saveLog(AccountLogDO accountLogDO) {
		accountLogDao.saveLog(accountLogDO);
	}

	@Override
	public List<AccountLogVO> findLogList(String accountNo) {
		return accountLogDao.findLogList(accountNo);
	}

	@Override
	public List<AccountLogVO> queryLogListByConditions(
			AccountLogQueryDto accountLogQueryDto) {

		return accountLogDao.queryByCondition(accountLogQueryDto);
	}

	@Override
	public PageVo queryLogPageByConditions(

	AccountLogQueryDto accountLogQueryDto) {

		Integer pageNum = accountLogQueryDto.getPageNo();

		Integer pageSize = accountLogQueryDto.getPageSize();

		PageVo pageVo = new PageVo();
		pageVo.setPageNo(pageNum);
		pageVo.setPageSize(pageSize);
		MybatisPageHelper.setPageVo(pageVo);

		List<AccountLogVO> list = accountLogDao
				.queryByCondition(accountLogQueryDto);
		pageVo.setRows(list);
		return pageVo;
	}

}
